package com.jpsl.core.reflection.property.f;

import com.jpsl.core.reflection.property.Accessible;

import java.lang.reflect.Field;

abstract class ByFieldPropertyAccessor implements Accessible {

    protected final String property;

    protected final Field field;

    protected ByFieldPropertyAccessor(String property, Field field) {
        this.property = property;
        this.field = field;
        field.setAccessible(true);
    }

    @Override
    public String getName() {
        return property;
    }

    @Override
    public Class<?> getType() {
        return field.getType();
    }

}
